@extends('templates.generalstructure')

@section('contenido')

	<div id="wrapper-perfil">
		{{ HTML::ul($errors->all()) }}
	
		{{ Form::open(array('url' => URL::route('perfil.update',$user->id),'method'=>'PUT')) }}
		
			<div class="form-group">
				{{ Form::label('username', 'Nombre de Usuario') }}
				{{ Form::text('username',$user->username, array('class' => 'form-control')) }}
			</div>
		
			<div class="form-group">
				{{ Form::label('email', 'Email') }}
				{{ Form::email('email', $user->email, array('class' => 'form-control')) }}
			</div>
			<div class="form-group">
				{{ Form::label('password', 'Password') }}
				{{ Form::password('password', array('class' => 'form-control ')) }}
			</div>
			{{ Form::submit('Guardar', array('class' => 'btn btn-primary')) }}
		
		{{ Form::close() }}
		
		@if ($user->comentarios->count())
		<div>
			{{ Form::label(null, 'Comentarios Totales:') }}
			{{ Form::label(null, $user->comentarios->count()) }}
		</div>
		@endif
		
		@if ($user->torneos->count())
		<div>
			{{ Form::label('null', 'Torneos('.$user->torneos->count().'):') }}
			<ul>
			@foreach ($user->torneos as $torneo)
				<li>{{ HTML::link(URL::route('torneo.detalle',$torneo->id),$torneo->titulo) }} ({{ date("d/m/Y",strtotime($torneo->fecha)) }} a las {{ date("H:i",strtotime($torneo->fecha)) }})</li>
			@endforeach
			</ul>
		</div>
		@endif
	</div>
@stop